﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Steering.SteeringAbstraction
{
    public abstract class ForkliftSteeringSource
    {
        public abstract event EventHandler StopIssued;
        public abstract event EventHandler MenuIssued;

        protected ValueSlider speed;
        protected ValueSlider turn;
        protected ValueSlider forkSpeed;

        protected int updatePause = 50;

        private bool isActive = true;

        public ValueSlider Speed
        {
            get { return speed; }
        }

        public ValueSlider Turn
        {
            get { return turn; }
        }

        public ValueSlider ForkSpeed
        {
            get { return forkSpeed; }
        }

        public int UpdatePause
        {
            get { return updatePause; }
        }

        public bool IsActive
        {
            get { return isActive; }
        }

        public ForkliftSteeringSource()
        {
            this.speed = new ValueSlider();
            this.turn = new ValueSlider();
            this.forkSpeed = new ValueSlider();
        }

        public abstract bool StartSteering();

        public abstract void StopSteering();

        public void Halt()
        {
            speed.Reset();
            turn.Reset();
            forkSpeed.Reset();
        }

        public abstract void UpdateSteering();
    }
}
